from datetime import datetime
from applications.extensions import db


# 受灾面积
class AffectedArea(db.Model):
    __tablename__ = 'affected_area'
    id = db.Column(db.Integer, primary_key=True)
    province_code = db.Column(db.String(255))
    province_name = db.Column(db.String(255))
    year = db.Column(db.String(255))
    indicator = db.Column(db.String(255))
    value = db.Column(db.Float)
    update_time = db.Column(db.DateTime, default=datetime.now)


# 产量
class AgriculturalYield(db.Model):
    __tablename__ = 'agricultural_yield'
    id = db.Column(db.Integer, primary_key=True)
    province_code = db.Column(db.String(255))
    province_name = db.Column(db.String(255))
    year = db.Column(db.String(255))
    indicator = db.Column(db.String(255))
    value = db.Column(db.Float)
    update_time = db.Column(db.DateTime, default=datetime.now)


# 种植
class PlantingArea(db.Model):
    __tablename__ = 'planting_area'
    id = db.Column(db.Integer, primary_key=True)
    province_code = db.Column(db.String(255))
    province_name = db.Column(db.String(255))
    year = db.Column(db.String(255))
    indicator = db.Column(db.String(255))
    value = db.Column(db.Float)
    update_time = db.Column(db.DateTime, default=datetime.now)
